package IMIC.NGUYENVANTINH.ARRAY.SIMPLE02;

import java.util.Scanner;

public class Views {
	public static void main(String[] args) {
		double[] arr = new double[10];
		boolean flag = false;
		// khai bao scanner de nguoi dung nhap vao tu ban phim
		Scanner sc = new Scanner(System.in);
		System.out.println("Nhap danh sach cac phan tu: ");
		while (!flag) {
			try {
				for (int i = 0; i < arr.length; i++) {
					System.out.print("arr[" + i + "]: ");
					arr[i] = sc.nextDouble();
					flag = true;
				}
			} catch (Exception e) {
				// TODO: handle exception
				System.out.println("Ban phai nhap vao kieu double...");
				sc.nextLine();
			}
		}
		Controllers ctrl = new Controllers();
		System.out.print("Max of Array is: " + ctrl.FindMaxArray(arr));
		System.out.println();
		System.out.print("Min of Array is: " + ctrl.FindMinArray(arr));
	}

}
